import request from "../../index";

// 分页获取事项列表
const getTips = (query) => {
    console.log(query);
  return request({
    url: "/tips",
    method: "get",
    params: query,
  });
};

// 新增事项
const addTip = (query) => {
  return request({
    url: "/tips",
    method: "post",
    data: query,
  });
};

// 删除事项
const deleteTip = (id) => {
  return request({
    url: `/tips/${id}`,
    method: "delete",
  });
};

// 修改事项
const editTip = (query) => {
  return request({
    url: `/tips/${query.id}`,
    method: "patch",
    data: query,
  });
};

export { getTips, addTip, deleteTip, editTip };
